﻿<%@ Page Language="C#" MasterPageFile="~/admin/adminMasterPage.master" AutoEventWireup="true" CodeFile="Partners.aspx.cs" Inherits="admin_Partners" Title="Untitled Page" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <title>Partners</title>
    <link rel="stylesheet" type="text/css" media="screen,projection,print" href="css/layout2_setup.css" />
    <link rel="stylesheet" type="text/css" media="screen,projection,print" href="css/layout2_text.css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder" Runat="Server">
<h1>
        Đối tác:
    </h1>
    <!--
   ---------------------------------------------------- sử dụng ajax-----------------------------------------------------------------------
    -->
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="grvPartners">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grvPartners" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
        <ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" />
    <!----------------------------------------hết đoạn sử dụng ajax-------------------------------------->
    <telerik:RadAjaxPanel ID="RadAjaxPanel" runat="server" Width="900px">
        <form action="">
        <telerik:RadTextBox ID="txtName" runat="server" EmptyMessage="- tên -" Width="300px" Label="Tên:" LabelCssClass="left" CssClass="field">
        </telerik:RadTextBox>
        <br />
        <label>Upload hình ảnh:</label>
                    <asp:FileUpload ID="FileUpload1" runat="server" Font-Size="Small" />
                    <br />
        <telerik:RadTextBox ID="txtLink" runat="server" Width="500px" EmptyMessage="- link -" Label="Link:" LabelCssClass="left" CssClass="field">
        </telerik:RadTextBox>
        <telerik:RadButton ID="btnAdd" runat="server" Text="- Add -" CssClass="button">
        </telerik:RadButton>
        </form>
    </telerik:RadAjaxPanel>
    <p />
    <hr class="clear-contentunit" />
    <telerik:RadGrid AutoGenerateColumns="False" ID="grvPartners" AllowFilteringByColumn="True"
        AllowPaging="True" AllowSorting="True" runat="server" Width="990px">
        <PagerStyle Mode="NextPrevAndNumeric" />
        <GroupingSettings CaseSensitive="false" />
        <MasterTableView TableLayout="Fixed" runat="server" AllowPaging="true" PageSize="10" DataKeyNames="partnerID">
            <Columns>
             <telerik:GridImageColumn DataImageUrlFields="avatar" ImageWidth="150px" ImageHeight="150px" HeaderText="Hình đại diện" UniqueName="avatar"
                            SortExpression="avatar" HeaderStyle-Width="150px" FilterControlWidth="60px"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />
            <telerik:GridBoundColumn HeaderText="Mã" DataField="partnerID" UniqueName="partnerID"
                    SortExpression="partnerID" HeaderStyle-Width="50px" FilterControlWidth="140px"
                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />
                <telerik:GridBoundColumn HeaderText="Tên Công Ty" DataField="company" UniqueName="company"
                    SortExpression="company" HeaderStyle-Width="250px" FilterControlWidth="140px"
                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />
                    <telerik:GridHyperLinkColumn HeaderText="Link" DataNavigateUrlFields="link" DataTextField="link" UniqueName="link"
                    SortExpression="link" HeaderStyle-Width="450px" FilterControlWidth="140px"
                    AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />
                 <telerik:GridCheckBoxColumn DataField="isActived" UniqueName="isActived" HeaderText="Kích hoạt"
                            HeaderStyle-Width="50px" />
                <telerik:GridButtonColumn ButtonType="ImageButton" Text="Delete" CommandName="Delete" 
                ConfirmText="Xóa đối tác này?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" />
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    <hr class="clear-contentunit" />
</asp:Content>

